/*
 * Point.cpp
 *
 *  Created on: 01/05/2013
 *      Author: Vitor
 */

#include "Point.h"

Point::Point() {
	x = 0;
	y = 0;
}

Point::Point(float x, float y) {
	this->x = x;
	this->y = y;
}

Point::~Point() {
}

float Point::distance(Point from) {
	return sqrt(
			pow(this->getX() - from.getX(), 2)
					+ pow(this->getY() - from.getY(), 2));
}

float Point::distanceSquared(Point from) {
	return pow(this->getX() - from.getX(), 2)
			+ pow(this->getY() - from.getY(), 2);
}

Point Point::addVector(Vector2 toAdd) {
	return Point(this->getX() + toAdd.getX(), this->getY() + toAdd.getY());
}
